3 struct MapNotes: View {
12 ForEach(notes, id: \.id) { note in
13 Text(note.text.replacingOccurrences(of: "\\n", with: "\n")).font(.theme.note)
16 .foregroundColor(.map.labelColor)
17 .border(Color.map.vertexColor, width: lineWidth)
18 .frame(minWidth: 16.0, maxWidth: maxWidth, alignment: .topLeading)
21 width: w(note.position.x),
22 height: h(note.position.y)
28 func h(_ dimension: CGFloat) -> CGFloat {
29 max(0.0, min(mapSize.height, dimension * mapSize.height / 100.0))
32 func w(_ dimension: CGFloat) -> CGFloat {
33 max(0.0, min(mapSize.width, dimension * mapSize.width / 100.0))
39 mapSize: CGSize(width: 400.0, height: 400.0), lineWidth: 1.0,
42 id: 0, position: CGPoint(x: 50.0, y: 50.0),
44 "Notes can have a lot more text, so we need to make sure that they're resized correctly")